package io.renren.modules.user.service.impl;

import io.renren.modules.generator.entity.TTrainingEntity;
import io.renren.modules.user.entity.TPeopleEntity;
import io.renren.modules.user.service.TPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.user.dao.TPeopleLogDao;
import io.renren.modules.user.entity.TPeopleLogEntity;
import io.renren.modules.user.service.TPeopleLogService;


@Service("tPeopleLogService")
public class TPeopleLogServiceImpl extends ServiceImpl<TPeopleLogDao, TPeopleLogEntity> implements TPeopleLogService {

    @Autowired
    private TPeopleService tPeopleService;
    @Autowired
    private TPeopleLogDao tPeopleLogDao;


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TPeopleLogEntity> page = this.page(
                new Query<TPeopleLogEntity>().getPage(params),
                new QueryWrapper<TPeopleLogEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveLog(TPeopleEntity tPeople) {
        List<TPeopleEntity> tPeopleEntityList = tPeopleService.list(new QueryWrapper<TPeopleEntity>().
                eq("id", tPeople.getId())
        );
        TPeopleEntity tPeopleEntity = tPeopleEntityList.get(0);
        //查询个人信息
        TPeopleEntity tPeopleEntity1 = tPeopleService.findPeople(tPeople.getId());
        //修改信息
        tPeopleService.updateById(tPeople);
        //修改后的查询个人信息
        TPeopleEntity people = tPeopleService.findPeople(tPeople.getId());
        //添加操作信息
        TPeopleLogEntity tPeopleLogEntity=new TPeopleLogEntity();
        if(null!=tPeople.getDept() && !tPeople.getDept().equals(tPeopleEntity.getDept())){
            tPeopleLogEntity.setFirstChanage("单位："+tPeopleEntity1.getDetachment());
            tPeopleLogEntity.setEndChanage("单位："+people.getDetachment());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        if(null !=tPeople.getClasses() &&!tPeople.getClasses().equals(tPeopleEntity.getClasses())) {
            tPeopleLogEntity.setFirstChanage("班组："+tPeopleEntity1.getClassesName());
            tPeopleLogEntity.setEndChanage("班组："+people.getClassesName());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }if(null !=tPeople.getName() &&!tPeople.getName().equals(tPeopleEntity.getName())) {
            tPeopleLogEntity.setFirstChanage("姓名："+tPeopleEntity.getName());
            tPeopleLogEntity.setEndChanage("姓名："+tPeople.getName());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null!=tPeople.getOldName() &&!tPeople.getOldName().equals(tPeopleEntity.getOldName())) {
            tPeopleLogEntity.setFirstChanage("曾用命："+tPeopleEntity.getOldName());
            tPeopleLogEntity.setEndChanage("曾用命："+tPeople.getOldName());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSex() && !tPeople.getSex().equals(tPeopleEntity.getSex())) {
            tPeopleLogEntity.setFirstChanage("性别："+tPeopleEntity1.getSex());
            tPeopleLogEntity.setEndChanage("性别："+people.getSex());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getEthnic() &&!tPeople.getEthnic().equals(tPeopleEntity.getEthnic())) {
            tPeopleLogEntity.setFirstChanage("民族："+tPeopleEntity1.getMinName());
            tPeopleLogEntity.setEndChanage("民族："+people.getMinName());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getBirthday() &&!tPeople.getBirthday().equals(tPeopleEntity.getBirthday())) {
            tPeopleLogEntity.setFirstChanage("生日："+tPeopleEntity.getBirthday());
            tPeopleLogEntity.setEndChanage("生日："+tPeople.getBirthday());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getBround() &&!tPeople.getBround().equals(tPeopleEntity.getBround())) {
            tPeopleLogEntity.setFirstChanage("籍贯："+tPeopleEntity.getBround());
            tPeopleLogEntity.setEndChanage("籍贯："+tPeople.getBround());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getIdcard() &&!tPeople.getIdcard().equals(tPeopleEntity.getIdcard())) {
            tPeopleLogEntity.setFirstChanage("身份证："+tPeopleEntity.getIdcard());
            tPeopleLogEntity.setEndChanage("身份证："+tPeople.getIdcard());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getWorkidcard() &&!tPeople.getWorkidcard().equals(tPeopleEntity.getWorkidcard())) {
            tPeopleLogEntity.setFirstChanage("工作证："+tPeopleEntity.getWorkidcard());
            tPeopleLogEntity.setEndChanage("工作证："+tPeople.getWorkidcard());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getDutytime() &&!tPeople.getDutytime().equals(tPeopleEntity.getDutytime())) {
            tPeopleLogEntity.setFirstChanage("入职时间："+tPeopleEntity.getDutytime());
            tPeopleLogEntity.setEndChanage("入职时间："+tPeople.getDutytime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } /*if(null !=tPeople.getTitleType() &&!tPeopleEntity.getTitleType().equals(tPeople.getTitleType())) {
            tPeopleLogEntity.setFirstChanage("衔级类别："+tPeopleEntity.getTitleType());
            tPeopleLogEntity.setEndChanage("衔级类别："+tPeople.getTitleType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }*/
        if(tPeople.getTitle()!=null  &&!tPeople.getTitle().equals(tPeopleEntity.getTitle())) {

            tPeopleLogEntity.setFirstChanage("衔级："+tPeopleEntity1.getTitleName());
            tPeopleLogEntity.setEndChanage("衔级："+people.getTitleName());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        if(null!=tPeople.getTitleTime() &&!tPeople.getTitleTime().equals(tPeopleEntity.getTitleTime())) {
            tPeopleLogEntity.setFirstChanage("当前衔级时间："+tPeopleEntity.getTitleTime());
            tPeopleLogEntity.setEndChanage("当前衔级时间："+tPeople.getTitleTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        if(null!=tPeople.getDutyPost() &&!tPeople.getDutyPost().equals(tPeopleEntity.getDutyPost())) {
            tPeopleLogEntity.setFirstChanage("专业岗位："+tPeopleEntity1.getGname());
            tPeopleLogEntity.setEndChanage("专业岗位："+people.getGname());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null!=tPeople.getDutyPostTime() &&!tPeople.getDutyPostTime().equals(tPeopleEntity.getDutyPostTime())) {
            tPeopleLogEntity.setFirstChanage("当前岗位时间："+tPeopleEntity.getDutyPostTime());
            tPeopleLogEntity.setEndChanage("当前岗位时间："+tPeople.getDutyPostTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
       /* if(null !=tPeople.getFirePost() &&!tPeopleEntity.getFirePost().equals(tPeople.getFirePost())) {
            tPeopleLogEntity.setFirstChanage("消防职务："+tPeopleEntity.getFirePost());
            tPeopleLogEntity.setEndChanage("消防职务："+tPeople.getFirePost());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getFirePostTime() &&!tPeopleEntity.getFirePostTime().equals(tPeople.getFirePostTime())) {
            tPeopleLogEntity.setFirstChanage("消防职务任职时间"+tPeopleEntity.getFirePostTime());
            tPeopleLogEntity.setEndChanage("消防职务任职时间"+tPeople.getFirePostTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }*/
        if(null!=tPeople.getFirePostClass() &&!tPeople.getFirePostClass().equals(tPeopleEntity.getFirePostClass())) {
            tPeopleLogEntity.setFirstChanage("职务等级："+tPeopleEntity1.getName7());
            tPeopleLogEntity.setEndChanage("职务等级："+people.getName7());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        if(null!=tPeople.getFireClassTime()&&!tPeople.getFireClassTime().equals(tPeopleEntity.getFireClassTime())) {
            tPeopleLogEntity.setFirstChanage("职务年月："+tPeopleEntity.getFireClassTime());
            tPeopleLogEntity.setEndChanage("职务年月："+tPeople.getFireClassTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
         /*if(null !=tPeople.getTecPost() &&!tPeopleEntity.getTecPost().equals(tPeople.getTecPost())) {
            tPeopleLogEntity.setFirstChanage("技术职务"+tPeopleEntity.getTecPost());
            tPeopleLogEntity.setEndChanage("技术职务"+tPeople.getTecPost());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getTecPostTime() &&!tPeopleEntity.getTecPostTime().equals(tPeople.getTecPostTime())) {
            tPeopleLogEntity.setFirstChanage("技术职务时间"+tPeopleEntity.getTecPostTime());
            tPeopleLogEntity.setEndChanage("技术职务时间"+tPeople.getTecPostTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }*/
        if(null !=tPeople.getTecClass() &&!tPeople.getTecClass().equals(tPeopleEntity.getTecClass())) {
            tPeopleLogEntity.setFirstChanage("技术等级："+tPeopleEntity.getTecClass());
            tPeopleLogEntity.setEndChanage("技术等级："+tPeople.getTecClass());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null!=tPeople.getTecClassTime() &&!tPeople.getTecClassTime().equals(tPeopleEntity.getTecClassTime())) {
            tPeopleLogEntity.setFirstChanage("技术等级年月："+tPeopleEntity.getTecClassTime());
            tPeopleLogEntity.setEndChanage("技术等级年月："+tPeople.getTecClassTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null!=tPeople.getAdministration() &&!tPeople.getAdministration().equals(tPeopleEntity.getAdministration())) {
            tPeopleLogEntity.setFirstChanage("行政职务："+tPeopleEntity.getAdministration());
            tPeopleLogEntity.setEndChanage("行政职务："+tPeople.getAdministration());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null!=tPeople.getAdministrationTime() &&!tPeople.getAdministrationTime().equals(tPeopleEntity.getAdministrationTime())) {
            tPeopleLogEntity.setFirstChanage("行政职务时间："+tPeopleEntity.getAdministrationTime());
            tPeopleLogEntity.setEndChanage("行政职务时间："+tPeople.getAdministrationTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getHousehold() &&!tPeople.getHousehold().equals(tPeopleEntity.getHousehold())) {
            tPeopleLogEntity.setFirstChanage("户籍："+tPeopleEntity.getHousehold());
            tPeopleLogEntity.setEndChanage("户籍："+tPeople.getHousehold());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getRegisterType() &&!tPeople.getRegisterType().equals(tPeopleEntity.getRegisterType())) {
            tPeopleLogEntity.setFirstChanage("户口类型："+tPeopleEntity1.getRegisterType());
            tPeopleLogEntity.setEndChanage("户口类型："+people.getRegisterType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getInvitationHousehold() &&!tPeople.getInvitationHousehold().equals(tPeopleEntity.getInvitationHousehold())) {
            tPeopleLogEntity.setFirstChanage("招录前户籍："+tPeopleEntity.getInvitationHousehold());
            tPeopleLogEntity.setEndChanage("招录前户籍："+tPeople.getInvitationHousehold());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getInvitationRegister() &&!tPeople.getInvitationRegister().equals(tPeopleEntity.getInvitationRegister())) {
            tPeopleLogEntity.setFirstChanage("招录前户籍类型："+tPeopleEntity1.getInvitationRegister());
            tPeopleLogEntity.setEndChanage("招录前户籍类型："+people.getInvitationRegister());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getInvitation() &&!tPeople.getInvitation().equals(tPeopleEntity.getInvitation())) {
            tPeopleLogEntity.setFirstChanage("招录地省："+tPeopleEntity1.getInvitation());
            tPeopleLogEntity.setEndChanage("招录地省："+people.getInvitation());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        /*if(null !=tPeople.getInvitation2() &&!tPeopleEntity.getInvitation2().equals(tPeople.getInvitation2())) {
            tPeopleLogEntity.setFirstChanage("招录地市"+tPeopleEntity.getInvitation2());
            tPeopleLogEntity.setEndChanage("招录地市"+tPeople.getInvitation2());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } */
        if(null !=tPeople.getPolitical() &&!tPeople.getPolitical().equals(tPeopleEntity.getPolitical())) {
            tPeopleLogEntity.setFirstChanage("政治面貌："+tPeopleEntity1.getPolitical());
            tPeopleLogEntity.setEndChanage("政治面貌："+people.getPolitical());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getPoliTime() &&!tPeople.getPoliTime().equals(tPeopleEntity.getPoliTime())) {
            tPeopleLogEntity.setFirstChanage("入党时间："+tPeopleEntity.getPoliTime());
            tPeopleLogEntity.setEndChanage("入党时间："+tPeople.getPoliTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getEducation() &&!tPeople.getEducation().equals(tPeopleEntity.getEducation())) {
            tPeopleLogEntity.setFirstChanage("文化程度："+tPeopleEntity1.getEducation());
            tPeopleLogEntity.setEndChanage("文化程度："+people.getEducation());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSchool() &&!tPeople.getSchool().equals(tPeopleEntity.getSchool())) {
            tPeopleLogEntity.setFirstChanage("毕业学校："+tPeopleEntity.getSchool());
            tPeopleLogEntity.setEndChanage("毕业学校："+tPeople.getSchool());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getMajor() &&!tPeople.getMajor().equals(tPeopleEntity.getMajor())) {
            tPeopleLogEntity.setFirstChanage("专业："+tPeopleEntity.getMajor());
            tPeopleLogEntity.setEndChanage("专业："+tPeople.getMajor());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getEducationTime() &&!tPeople.getEducationTime().equals(tPeopleEntity.getEducationTime())) {
            tPeopleLogEntity.setFirstChanage("毕业时间："+tPeopleEntity.getEducationTime());
            tPeopleLogEntity.setEndChanage("毕业时间："+tPeople.getEducationTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSolo() &&!tPeople.getSolo().equals(tPeopleEntity.getSolo())) {
            tPeopleLogEntity.setFirstChanage("独生子女："+tPeopleEntity1.getSolo());
            tPeopleLogEntity.setEndChanage("独生子女："+people.getSolo());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getCadre() &&!tPeople.getCadre().equals(tPeopleEntity.getCadre())) {
            tPeopleLogEntity.setFirstChanage("干部子女："+tPeopleEntity1.getCadre());
            tPeopleLogEntity.setEndChanage("干部子女："+people.getCadre());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getHomeType() &&!tPeople.getHomeType().equals(tPeopleEntity.getHomeType())) {
            tPeopleLogEntity.setFirstChanage("家庭情况："+tPeopleEntity1.getHomeType());
            tPeopleLogEntity.setEndChanage("家庭情况："+people.getHomeType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        /* if(null !=tPeople.getFireIdcard() &&!tPeopleEntity.getFireIdcard().equals(tPeople.getFireIdcard())) {
            tPeopleLogEntity.setFirstChanage("消防员证"+tPeopleEntity.getFireIdcard());
            tPeopleLogEntity.setEndChanage("消防员证"+tPeople.getFireIdcard());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } */
        if(null !=tPeople.getBlood() &&!tPeople.getBlood().equals(tPeopleEntity.getBlood())) {
            tPeopleLogEntity.setFirstChanage("血型："+tPeopleEntity.getBlood());
            tPeopleLogEntity.setEndChanage("血型："+tPeople.getBlood());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
        if(null !=tPeople.getHight() &&!tPeople.getHight().equals(tPeopleEntity.getHight())) {
            tPeopleLogEntity.setFirstChanage("身高："+tPeopleEntity.getHight());
            tPeopleLogEntity.setEndChanage("身高："+tPeople.getHight());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }
       /* if(null !=tPeople.getMarry() &&!tPeopleEntity.getMarry().equals(tPeople.getMarry())) {
            tPeopleLogEntity.setFirstChanage("婚姻状况"+tPeopleEntity.getMarry());
            tPeopleLogEntity.setEndChanage("婚姻状况"+tPeople.getMarry());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getMarryTime() &&!tPeopleEntity.getMarryTime().equals(tPeople.getMarryTime())) {
            tPeopleLogEntity.setFirstChanage("结婚时间"+tPeopleEntity.getMarryTime());
            tPeopleLogEntity.setEndChanage("结婚时间"+tPeople.getMarryTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSpouse() &&!tPeopleEntity.getSpouse().equals(tPeople.getSpouse())) {
            tPeopleLogEntity.setFirstChanage("配偶户籍"+tPeopleEntity.getSpouse());
            tPeopleLogEntity.setEndChanage("配偶户籍"+tPeople.getSpouse());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getKids() &&!tPeopleEntity.getKids().equals(tPeople.getKids())) {
            tPeopleLogEntity.setFirstChanage("生育情况"+tPeopleEntity.getKids());
            tPeopleLogEntity.setEndChanage("生育情况"+tPeople.getKids());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getAddress() &&!tPeopleEntity.getAddress().equals(tPeople.getAddress())) {
            tPeopleLogEntity.setFirstChanage("地址"+tPeopleEntity.getAddress());
            tPeopleLogEntity.setEndChanage("地址"+tPeople.getAddress());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSocialCard() &&!tPeopleEntity.getSocialCard().equals(tPeople.getSocialCard())) {
            tPeopleLogEntity.setFirstChanage("社保卡"+tPeopleEntity.getSocialCard());
            tPeopleLogEntity.setEndChanage("社保卡"+tPeople.getSocialCard());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }*/
       if(null !=tPeople.getContractType() &&!tPeople.getContractType().equals(tPeopleEntity.getContractType())) {
            tPeopleLogEntity.setFirstChanage("合同期限"+tPeopleEntity1.getContractType());
            tPeopleLogEntity.setEndChanage("合同期限"+people.getContractType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSeniorityHistory() &&!tPeople.getSeniorityHistory().equals(tPeopleEntity.getSeniorityHistory())) {
            tPeopleLogEntity.setFirstChanage("入职前工龄"+tPeopleEntity.getSeniorityHistory());
            tPeopleLogEntity.setEndChanage("入职前工龄"+tPeople.getSeniorityHistory());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSeniorityNow() &&!tPeople.getSeniorityNow().equals(tPeopleEntity.getSeniorityNow())) {
            tPeopleLogEntity.setFirstChanage("本单位工龄"+tPeopleEntity.getSeniorityNow());
            tPeopleLogEntity.setEndChanage("本单位工龄"+tPeople.getSeniorityNow());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getSeniorityTotal() &&!tPeople.getSeniorityTotal().equals(tPeopleEntity.getSeniorityTotal())) {
            tPeopleLogEntity.setFirstChanage("总工龄"+tPeopleEntity.getSeniorityTotal());
            tPeopleLogEntity.setEndChanage("总工龄"+tPeople.getSeniorityTotal());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getCallPhone() &&!tPeople.getCallPhone().equals(tPeopleEntity.getCallPhone())) {
            tPeopleLogEntity.setFirstChanage("手机"+tPeopleEntity.getCallPhone());
            tPeopleLogEntity.setEndChanage("手机"+tPeople.getCallPhone());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getFileNumber() &&!tPeople.getFileNumber().equals(tPeopleEntity.getFileNumber())) {
            tPeopleLogEntity.setFirstChanage("档案号码"+tPeopleEntity.getFileNumber());
            tPeopleLogEntity.setEndChanage("档案号码"+tPeople.getFileNumber());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getStrength() &&!tPeople.getStrength().equals(tPeopleEntity.getStrength())) {
            tPeopleLogEntity.setFirstChanage("特长"+tPeopleEntity.getStrength());
            tPeopleLogEntity.setEndChanage("特长"+tPeople.getStrength());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getInstructions() &&!tPeople.getInstructions().equals(tPeopleEntity.getInstructions())) {
            tPeopleLogEntity.setFirstChanage("说明"+tPeopleEntity.getInstructions());
            tPeopleLogEntity.setEndChanage("说明"+tPeople.getInstructions());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }/* if(null !=tPeople.getPicture() &&!tPeopleEntity.getPicture().equals(tPeople.getPicture())) {
            tPeopleLogEntity.setFirstChanage("图片"+tPeopleEntity.getPicture());
            tPeopleLogEntity.setEndChanage("图片"+tPeople.getPicture());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }*/
        if(null !=tPeople.getAccessories() &&!tPeople.getAccessories().equals(tPeopleEntity.getAccessories())) {
            tPeopleLogEntity.setFirstChanage("附件"+tPeopleEntity.getAccessories());
            tPeopleLogEntity.setEndChanage("附件"+tPeople.getAccessories());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getState() &&!tPeople.getState().equals(tPeopleEntity.getState())) {
            tPeopleLogEntity.setFirstChanage("状态"+tPeopleEntity.getState());
            tPeopleLogEntity.setEndChanage("状态"+tPeople.getState());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getEffective() &&!tPeople.getEffective().equals(tPeopleEntity.getEffective())) {
            tPeopleLogEntity.setFirstChanage("有效性"+tPeopleEntity.getEffective());
            tPeopleLogEntity.setEndChanage("有效性"+tPeople.getEffective());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getPeopleType() &&!tPeople.getPeopleType().equals(tPeopleEntity.getPeopleType())) {
            tPeopleLogEntity.setFirstChanage("人员类型"+tPeopleEntity.getPeopleType());
            tPeopleLogEntity.setEndChanage("人员类型"+tPeople.getPeopleType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getOutType() &&!tPeople.getOutType().equals(tPeopleEntity.getOutType())) {
            tPeopleLogEntity.setFirstChanage("退出类型"+tPeopleEntity.getOutType());
            tPeopleLogEntity.setEndChanage("退出类型"+tPeople.getOutType());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        } if(null !=tPeople.getOutTime() &&!tPeople.getOutTime().equals(tPeopleEntity.getOutTime())) {
            tPeopleLogEntity.setFirstChanage("退出时间"+tPeopleEntity.getOutTime());
            tPeopleLogEntity.setEndChanage("退出时间"+tPeople.getOutTime());
            tPeopleLogEntity.setPeopleId(tPeople.getId());
            tPeopleLogEntity.setCreateUser(tPeople.getCreateUser());
            tPeopleLogEntity.setCreateTime(new Date());
            this.save(tPeopleLogEntity);
        }

    }


    /**
     * 列表
     */
    public PageUtils peopleLog(Map<String, Object> params){
        IPage<TPeopleLogEntity> page = new Query<TPeopleLogEntity>().getPage(params);
        List<TPeopleLogEntity> teople = tPeopleLogDao.peopleLog(params);
        page.setRecords(teople);
        return new PageUtils(page);
    }

}